﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Refract.UI.Docking">
    <Style TargetType="local:DockableElement">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="local:DockableElement">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" OpacityMask="{Binding OpacityMask, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" Cursor="Hand">
                        <StackPanel x:Name="Core" Margin="5"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
           
    <Style TargetType="local:DockFrame">
        <Setter Property="Template">
            <Setter.Value>

                <!-- ControlTemplate -->
                <ControlTemplate TargetType="local:DockFrame">

                    <!-- Template's Root Visual -->
                    <StackPanel x:Name="Core">
                        <!-- VisualStateManager -->
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hover">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF007C04" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="Frame"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="Frame">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>3</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Undockable">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF8E0000" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="Frame"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="Frame">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>3</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DockStates">
                                <VisualState x:Name="Docked"/>
                                <VisualState x:Name="Undocked"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Frame" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" OpacityMask="{Binding OpacityMask, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="Black" BorderThickness="3">
                            <Canvas x:Name="Container" Margin="8"/>
                        </Border>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>